<template>
	<view class="pr">
		<image src="/static/img/my/bg.png" class="w-max pa top0 left0" style="max-height: 100%;" mode="widthFix" />
		<u-navbar :is-back="false" :border-bottom="false" title="个人中心" titleBold :is-fixed="false"
			:background="{ background: '#0000' }">
			<view class="pl20 pr20 flex row-between w-max">
				<view class=""></view>
				<view class="" @click="$jump('set/set')">
					<image src="/static/img/my/set.png" class="w46 h46" mode="" />
				</view>
			</view>
		</u-navbar>
		<kefu />
		<view class="pr p30 z-index1 top0">
			<view class="flex mb30" @click="$jump('./set/userInfo')">
				<view class="flex1">
					<userInfo />
				</view>
				<u-icon name="arrow-right"></u-icon>
			</view>

			<view class=" radius12  w-max flex mb20 tc" @click.stop="">
				<view class="flex1">
					<view class="color-666">工作年限</view>
					<view class="fw-w mt20 fs40">{{$user.work_year||0}}</view>
				</view>
				<view class="flex1" @click="$jump('/pages/my/menu/my_evaluate')">
					<view class="color-666">好评数量</view>
					<view class="fw-w mt20 fs40">{{$user.good_comment||0}}</view>
				</view>
				<view class="flex1">
					<view class="color-666">服务人数</view>
					<view class="fw-w mt20 fs40">{{$user.service_num||0}}</view>
				</view>
			</view>

			<view class="flex mb30">
				<view class="bg-f8f h148 radius12 box-shadow flex1 p20" @click="$jump('/pages/my/balance/balance')">
					<view class="flex ">
						<view class="mr20 color-666"> 今日收益 (元) </view>
						<view @click.stop="show.bail=!show.bail">
							<u-icon :name="show.bail?'eye-off':'eye-fill'" size="32" />
						</view>
					</view>
					<view class="fw-w fs36 mt10">
						<text>￥</text>
						<text v-if="show.bail">{{$user.today_income||0}}</text>
						<text v-else>****</text>
					</view>
				</view>
				<view class="w20"></view>
				<view class="bg-f8f h148 radius12 box-shadow flex1  p20" @click="$jump('/pages/my/balance/earnest')">
					<view class="flex ">
						<view class="mr20 color-666"> 保证金 (元) </view>
						<view @click.stop="show.day=!show.day">
							<u-icon :name="show.day?'eye-off':'eye-fill'" size="32" />
						</view>
					</view>
					<view class="fw-w fs36 mt10">
						<text>￥</text>
						<text v-if="show.day">{{$user.earnest_money||0}}</text>
						<text v-else>****</text>
					</view>
				</view>
			</view>
			<view class="p20 bg-fff radius20 p20">
				<view class="fw-w fs32 mb20">常用工具</view>
				<view class=" radius16 flex flex-wrap tc fs26 mb30">
					<view class="pt30 pb30 w25p" @click="$jump(item.url)" v-for="(item, index) in mylist" :key="index">
						<image :src="item.icon" class="w84 h84" mode=""></image>
						<view class="mt14 ">{{ item.name }}</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				show: {
					day: false,
					bail: false,
				},
				banner: '',
				// mylist: []
			};
		},
		computed: {
			mylist() {
				let list = [{
						name: '我的团队',
						icon: '/static/img/my/menu/jgtd.png',
						url: '/pages/my/team/team',
						show: this.$config.is_show_agency == 1
					},
					{
						name: '专属主页',
						icon: '/static/img/my/menu/zszy.png',
						url: '/pages/my/menu/myIndex',
						show: this.$config.is_show_homepage == 1
					},
					{
						name: '体检报告',
						icon: '/static/img/my/menu/tjbg.png',
						url: '/pages/my/menu/examine_log'
					},
					// {
					// 	name: '护理项目',
					// 	icon: '/static/img/my/menu/hlxm.png',
					// 	url: ''
					// },
					// {
					// 	name: '我的地址',
					// 	icon: '/static/img/my/menu/wddz.png',
					// 	url: '/pages/my/address/address'
					// },
					{
						name: '客户管理',
						icon: '/static/img/my/menu/khgl.png',
						url: '/pages/my/client/client',
						show: this.$config.is_show_member == 1
					},
					{
						name: '邀请好友',
						icon: '/static/img/my/menu/yqhy.png',
						url: '/pages/my/menu/invite'
					},
					{
						name: '我的分销',
						icon: '/static/img/my/menu/wdfx.png',
						url: '/pages/my/menu/performance'
					},
					{
						name: '合伙人加入',
						icon: '/static/img/my/menu/hhrjr.png',
						url: '/pages/my/menu/partner?type=partner'
					},
					{
						name: '意见反馈',
						icon: '/static/img/my/menu/yjfk.png',
						url: '/pages/my/menu/feedback'
					},
				]
				list = list.filter(e => !(typeof(e.show) == 'boolean' && !e.show))
				return list
			}
		},
		onShow() {
			this.$getUser()
			// this.$getData('qqqqq','31213')
		},
		onLoad() {

		},
		onPageScroll: function(e) {
			this.scrollTop = e.scrollTop
		},
		methods: {
			click(item) {
				item.methods ? item.methods() : this.$jump(item.url, item.params)
			},
		}
	}
</script>

<style lang="scss">
	// page {
	// 	// background: #f0f2f5;
	// }
</style>